package com.easyfile.easyfilemaster.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author chenpeman
 * @date 2022年05月06日 15:51
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("folder")
public class FolderDetail {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private Long pid;
    private String name;
    private Long userId;
    private Long folderNumber;
    private Long fileNumber;
    private Double fileCapacity;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    private Long version;
    @TableLogic
    private Integer deleted;

    /**
     * 转换成folderInfo
     *
     * @return the user info
     */
    public FolderInfo toFolderInfo(){
        return new FolderInfo(id,pid,name,userId,folderNumber,fileNumber,fileCapacity,createTime,updateTime);
    }
}
